﻿
Imports System.Data.SqlClient

Public Class Order

    Private Sub Order_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim cn As New SqlConnection
        cn.ConnectionString = "Server =DELL-PC\SQLEXPRESS; Database = SaleManagement; UID = sa; PWD = 123"
        cn.Open()

        Dim cmd As New SqlCommand
        cmd.Connection = cn
        cmd.CommandText = "SELECT * FROM TBL_Order"
        Dim reader As SqlDataReader
        reader = cmd.ExecuteReader
        Dim dt As New DataTable
        dt.Load(reader)
        reader.Close()
        DataGridView1.DataSource = dt
    End Sub
End Class